package com.Design.Flyweight;

import com.Design.abstractory.two.IFactroy.IFactory;

import java.util.HashMap;

/**
 * @Author Lc
 * @Date 2023/10/2
 * @PackageName: com.Design.Flyweight
 * @ClassName: WebSiteFactory
 * @Description:
 */

public class WebSiteFactory {
    private HashMap<String, WebSite> webSiteHashMap = new HashMap<>();

    public WebSite getWebSite(String name){
        if(!webSiteHashMap.containsKey(name)){
            webSiteHashMap.put(name,new WebSite(name));
        }
      return webSiteHashMap.get(name);
    }

    public Integer getWebSize(){
        return webSiteHashMap.size();
    }
}
